package com.zhentao.controller;

import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.pojo.par.param.ChargeOrdersParam;
import com.zhentao.model.pojo.user.dto.parDto;
import com.zhentao.service.ChargeParNameService;
import com.zhentao.service.ChargeParOrdersService;
import com.zhentao.service.ChargeUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/auth/user")
public class ChargeParController {
    @Resource
    ChargeParNameService chargeParNameService;
    @Autowired
    private ChargeParOrdersService ordersService;

    @GetMapping("/parList")
    public ResponseResult getParList() {
        return chargeParNameService.getParList();
    }

    @Resource
    ChargeUserService chargeUserService;

    @GetMapping("/PurseMoney")
    public ResponseResult getPurseMoney() {
        return chargeUserService.GetPurseMoney();
    }

    @PostMapping("/Remittance")
    public ResponseResult Remittance(@RequestBody parDto pardto) {
        return chargeUserService.Remittance(pardto);
    }

    /**
     * @description  查询已经支付的订单
     * @author 振涛教育_小Q
     * @date    2025/1/3 9:10
      * @param param
     * @return com.zhentao.model.common.dtos.ResponseResult
     */
    @PostMapping("/order/query")
    public ResponseResult payOrdersList(@RequestBody ChargeOrdersParam param){
        return ordersService.payOrdersList(param);
    }
}
